<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>电商平台商家大数据系统-登录</title>
    <link rel="icon" href="images/icon.png">
    <link rel="stylesheet" href="./css/login.css">
</head>
<body>
    <div class="login">
        <h1>电商平台商家大数据系统</h1>
        <form action="./index.html"> 
            <!-- <label for="username">用户名</label> -->
            <input type="text" id="uname" value="" placeholder="用户名admin"/><br>
            <input type="password" id="pwd" value="" placeholder="密码123"/><br>
            <input type="submit" id="but" value="登录" onclick="return checkuser()"/> 
            <!-- 返回了true就会打开页面  -->
        </form> 
    </div>
</body> 
 
<script type="text/javascript"> 
    function getValue(id) { 
        return document.getElementById(id).value; 
        // 查找元素
    } 
    function checkuser() { 
        if(getValue('uname') == "admin" && getValue('pwd') == "123") { 
            return true; 
        }else { 
            alert("登录名或密码错误！")
            // 警告框
            return false; 
        } 
    } 
</script> 
</html>
